package jlfm.lastfm.apps.recorder;

import java.util.ArrayList;
import java.util.List;

public class SequentialProgressListener implements ProgressListener {
	private List<ProgressListener> progressListeners = new ArrayList<ProgressListener>();

	public void progressFinished(ProgressEvent e) {
		for (ProgressListener l : progressListeners) {
			l.progressFinished(e);
		}
	}

	public void progressStarted(ProgressEvent e) {
		for (ProgressListener l : progressListeners) {
			l.progressStarted(e);
		}
	}

	public void progressUpdated(ProgressEvent e) {
		for (ProgressListener l : progressListeners) {
			l.progressUpdated(e);
		}
	}

	public void addProgressListener(ProgressListener pl) {
		progressListeners.add(pl);
	}

	public boolean removeProgressListener(ProgressListener pl) {
		return progressListeners.remove(pl);
	}

}
